package com.byq.mm.gateway;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TabHost;
import android.widget.TextView;
import android.widget.TabHost.TabSpec;

import com.byq.mm.smartlib.SmartAgent;
import com.byq.mm.smartlib.application.SmartApplication;
import com.byq.mm.smartlib.R;

public class GatewayActivity extends TabActivity {
	 protected SmartApplication application;
	  @Override
	  public void onCreate(Bundle icicle) {
	    super.onCreate(icicle);
	    requestWindowFeature(Window.FEATURE_NO_TITLE);
	    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams. FLAG_FULLSCREEN);
	    application = (SmartApplication) this.getApplication();
	  
	 TabHost tabHost = getTabHost();
	 LayoutInflater mInflater = LayoutInflater.from(this);
	
	 {
		 View v = mInflater.inflate(R.layout.cluster_icon_text, null);
		 TextView text = (TextView)v.findViewById(R.id.text);
		 ImageView iv = (ImageView)v.findViewById(R.id.icon);
		 text.setText(com.byq.mm.gateway.R.string.home);
		 iv.setImageResource(R.drawable.home);
		 TabSpec tab = tabHost.newTabSpec("")
	                  .setIndicator(v)
	                  .setContent(new Intent(this, HomeActivity.class));
	     tabHost.addTab(tab);
	 }
	     {
		 View v = mInflater.inflate(R.layout.cluster_icon_text, null);
		 TextView text = (TextView)v.findViewById(R.id.text);
		 ImageView iv = (ImageView)v.findViewById(R.id.icon);
		 text.setText(R.string.friends);
		 iv.setImageResource(R.drawable.edit_user);
		 TabSpec tab = tabHost.newTabSpec("")
	                  .setIndicator(v)
	                  .setContent(new Intent(this, SmartAgent.class));
	     tabHost.addTab(tab);
	     }
   }

}
